//
//  CrmBaseViewController.m
//  crm
//
//  Created by weacar on 2017/12/14.
//  Copyright © 2017年 weacar.com. All rights reserved.
//

#import "CrmBaseViewController.h"
#import "UINavigationItem+CH.h"

@interface CrmBaseViewController ()

@end

@implementation CrmBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self.view setBackgroundColor:KColor_White];
    
    //是否显示返回按钮
    self.hiddenBackBT = NO;
}

- (void)setHiddenBackBT:(BOOL)hiddenBackBT{
    if (!hiddenBackBT && (self.navigationController.viewControllers.count > 1 || self.navigationController.presentingViewController != nil)) {
        kSelf;
        [self.navigationItem ys_itmeType:LeftItemType itemNames:@[@"left_arrows"] firstItemSpaceWithScreen:0 itemSpace:0 handlerBlock:^(NSInteger indexPath) {
            if (wSelf.presentingViewController) {
                [wSelf dismissViewControllerAnimated:YES completion:nil];
            }else{
                [wSelf.navigationController popViewControllerAnimated:YES];
            }
        }];
    }
}

- (UITableView *)tableView{
    if (!_tableView) {
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kMainWidth, kMainHeight)];
        _tableView.backgroundColor = [UIColor whiteColor];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.showsVerticalScrollIndicator = FALSE;
        _tableView.showsHorizontalScrollIndicator = FALSE;
        [_tableView setTableFooterView:[[UIView alloc] initWithFrame:CGRectZero]];
        _tableView.separatorColor = [WWColorKit CCCellLineColor];
        _tableView.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0);
        _tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
        //        _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRereshing)];
        //        _tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRereshing)];
        [self.view addSubview:self.tableView];
    }
    return _tableView;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
